<div id="manager">
    <div>
        <div id="bg-title1"><img src="/images/bg-title1.jpg" alt=""></div>
        <div id="bg-title2"><img src="/images/icon-title.jpg" style="margin-right: 8px;" alt="">Quản lý nhóm của: <?=$name?></div>
        <div id="bg-title3"><img src="/images/bg-title3.jpg" alt=""></div>
        <div class="clearfloat"></div>
    </div>
    <div id="content">
        <div class="area-button">
            <div class="area-button1">
                <a href="#" onclick="_update('<?=$admin?>', document.getElementsByName('group_list'));" class="button">Cập nhật</a>
            </div>
        </div>
        <div>
            <table class="datagrid" width="100%" cellspacing="1" border="0">
                <tr>
                    <th>Tên truy cập</th>
                    <th>Tên đầy đủ</th>
                    <th>Email</th>
                    <th>Nhóm</th>
                </tr>
                <tr>
                    <td class="cellleft"><a href="/admin/edit?id=<?=$admin?>"><?=$name?></a></td>
                    <td class="cellleft"><?=$fullname?></td>
                    <td class="cellleft"><?=$mail?></td>
                    <td class="cellright"><?=$group?></td>
                </tr>
            </table>
            <table class="datagrid" width="100%" cellspacing="1" border="0">
                <tbody>
                    <tr>
                        <th width="10"><input type="checkbox" id="check-all" onclick="checkAllBox(this.id, 'content');" /></th>
                        <th style="text-align:left;">Nhóm</th>
                    </tr><?php
                    foreach($arrGroup as $group){?>
                        <tr>
                            <td><?php
                                $size = sizeof($arrGroupAdmin);
                                $checke = '';
                                for($i =0; $i < $size; $i ++){
                                    if($arrGroupAdmin[$i]['group_id'] == $group['group_id']){
                                        $checke = 'checked';
                                    }
                                }?>
                                <input name="group_list" type="checkbox" value="<?=$group['group_id']?>" <?=$checke?>/>
                            </td>
                            <td style="text-align:left;">
                                <?=$group['name']?>
                            </td>
                        </tr><?
                    }?>
                </tbody>
            </table>
        </div>
    </div>
</div>
<div class="clearfloat"></div>
<script type="text/javascript">
    function _search(group, text){
        location.href = "/admin?group=" + group + "&text=" + text;
    }
    function _update(admin, item){
        var list = '';
        for(var i =0; i < item.length; i ++){
            if(item[i].checked){
                list += item[i].value + ',';
            }
        }
        location.href = "/admin/update?admin=" + admin + "&list=" + list;
    }
</script>